#ifndef __DATABASECTL_H_
#define __DATABASECTL_H_
#include "Stypes.h"
#include <sqlite3.h>


//1 for ok, 0 for failed
int verify_user(const char *username, const char *passwd);

// 1 for isexist, 0 for no this name
int user_isexist(const char *username);


int add_user(const struct mem_info *mem);

int del_user(const struct mem_info *mem);

int select_table_byname(const char *username, struct mem_info *mem);

int modify_table_byname(const char *username, char *column_name, char *column_value);

int get_all_name(char **buf);

void free_all_name(char *buf);

int get_all_msg(char **buf);

void free_all_msg(char *buf);

#endif
